In [43]:
%reset
%pylab
%pdb off

# Can do "%pylab" or "%pylab inline"

# Cheat sheet:
# np.array([v1, v2])
# np.array([rVec[0], iVec[0], cVec[0]])  # makes a 3x3 matrix
# np.linspace(v1, v2, numPoints)
# np.concatenate(( a1, a2 ))
# print shape(waypoints.RIC)


Once deleted, variables cannot be recovered. Proceed (y/[n])? y
Using matplotlib backend: MacOSX
Populating the interactive namespace from numpy and matplotlib
Automatic pdb calling has been turned OFF

Import libraries


In [44]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.integrate as integrate

from IPython.display import display
from IPython.core.display import HTML

import thesis_functions.utilities
from thesis_functions.initial_conditions import initial_condition_sets
from thesis_functions.visualization import CreatePlotGrid, SetPlotGridData, ConfigurePlotLegend
from thesis_functions.astro import FindOrbitCenter, ComputeLibrationPoints, stop_yEquals0, stop_zEquals0
from thesis_functions.astro import ComputeNonlinearDerivs, ComputeRelmoDynamicsMatrix
from thesis_functions.astro import odeintNonlinearDerivs, odeintNonlinearDerivsWithLinearRelmoSTM, odeintNonlinearDerivsWithLinearRelmo
from thesis_functions.astro import ComputeRequiredVelocity, PropagateSatelliteAndChaser, TargetRequiredVelocity 
from thesis_functions.astro import PropagateSatellite, ComputeOffsets, ConvertOffset, BuildRICFrame, BuildVNBFrame
from thesis_functions.astro import BuildRICFrames, BuildVNBFrames, ConvertOffsets

from thesis_functions.major_simulation_components import set_up_target, compute_RLP_properties, set_active_point, plot_full_orbit, plot_initial_condition, define_waypoints_RIC
from thesis_functions.major_simulation_components import convert_waypoints_RLP_VNB, travel_waypoints, compute_waypoint_metrics

Set up plots


In [45]:
# Create plots

# Allowed colors:
# b: blue
# g: green
# r: red
# c: cyan
# m: magenta
# y: yellow
# k: black
# w: white

# Allowed axis modes: 'auto' and 'equal'
axis_mode = 'auto'

# Plots of offset in RLP, RIC, VNB frames
axis_array_RLP = CreatePlotGrid('Offset between Satellites 1 and 2 in RLP Frame', 'X', 'Y', 'Z', axis_mode)
axis_array_RIC = CreatePlotGrid('Offset between Satellites 1 and 2 in RIC Frame', 'R', 'I', 'C', axis_mode)
axis_array_VNB = CreatePlotGrid('Offset between Satellites 1 and 2 in VNB Frame', 'V', 'N', 'B', axis_mode)

# create plots showing the target satellite in one full orbit
axis_array_RLP_absolute = CreatePlotGrid('Satellite 1 Orbit in RLP Frame', 'X', 'Y', 'Z', 'equal')

In [46]:
first = True 

def run_waypoint_traveler(halo, clock_angle, approach, timescale, spacing):
    
    target_initial_state, period, mu = set_up_target(halo, clock_angle, initial_condition_sets, axis_array_RLP, axis_array_RIC, axis_array_VNB)
    
    RLP_properties = compute_RLP_properties(mu)
    
    set_active_point(target_initial_state, RLP_properties)
    
    if (first == True):
        plot_full_orbit(target_initial_state, RLP_properties, period, mu, axis_array_RLP_absolute)
    
    plot_initial_condition(target_initial_state, RLP_properties, axis_array_RLP_absolute)
    
    #print RLP_properties
    
    waypoints = define_waypoints_RIC(approach, spacing, timescale, RLP_properties, axis_array_RIC)
    
    waypoints = convert_waypoints_RLP_VNB(target_initial_state, waypoints, RLP_properties, axis_array_RLP, axis_array_VNB)
    
    # set_up_plots()
    
    waypoints, waypoint_velocities = travel_waypoints(target_initial_state, waypoints, RLP_properties, axis_array_RLP, axis_array_RIC, axis_array_VNB)
    
    waypoint_metrics = compute_waypoint_metrics(halo, clock_angle, approach, timescale, spacing, waypoints, waypoint_velocities, RLP_properties)

    # Period of libration point orbit (in nondimensional time units)
    #print 'Period of libration point orbit in seconds', period*RLP_properties.time_const

    #print 'waypoints.RLP_achieved_analytic_nonlin', display(HTML(waypoints.RLP_achieved_analytic_nonlin.to_html()))
    #print 'waypoints.RLP_achieved_targeted_nonlin', display(HTML(waypoints.RLP_achieved_targeted_nonlin.to_html()))

    return waypoint_metrics

Test Case Inputs


In [47]:
#halo_cases = ['small', 'medium', 'large', 'greater']
halo_cases = ['EM']
#halo_cases = ['small']
approach_cases = ['+R', '-R', '+I', '-I', '+C', '-C']

# not used yet:
timescales = ['fast', 'medium', 'slow']
spacings = ['close', 'medium', 'far']

# Used for first set of results in paper:
#halo_cases = ['EM']
#clock_angles = np.array([0.0])

# Used for second set of results in paper:
halo_cases = ['EM']
clock_angles = np.arange(0.0, 360.0, 1.0)

halo = halo_cases[0]
clock_angle = clock_angles[0]
approach = '+I'
timescale = timescales[0]
spacing = spacings[0]

print halo, clock_angle, approach, timescale, spacing


EM 0.0 +I fast close

In [48]:
#run_waypoint_traveler(halo, clock_angle, approach, timescale, spacing)


#results = pd.DataFrame(...)
#for halo, clock_angle, approach, timescale, spacing in configuration:


summary_metrics = pd.DataFrame({'halo':           len(clock_angles),
                             'clock_angle':    len(clock_angles),
                             'approach':       len(clock_angles),
                             'timescale':      len(clock_angles),
                             'spacing':        len(clock_angles),
                             'sum_DV_targeted': len(clock_angles),
                             'sum_DV_analytic': len(clock_angles),
                             'sum_DV_magnitude_difference': len(clock_angles),
                             'sum_DV_angle_difference': len(clock_angles),
                             'sum_achieved_position_error_analytic': len(clock_angles),
                             'sum_achieved_position_error_targeted': len(clock_angles)},
                            index=[clock_angles])

for halo in halo_cases:
    for clock_angle in clock_angles:

        current_results = run_waypoint_traveler(halo, clock_angle, approach, timescale, spacing)   
        
        # compute and record summary metrics
        summary_metrics.halo.loc[clock_angle] = halo
        summary_metrics.clock_angle.loc[clock_angle] = clock_angle
        summary_metrics.approach.loc[clock_angle] = approach
        summary_metrics.timescale.loc[clock_angle] = timescale
        summary_metrics.spacing.loc[clock_angle] = spacing
        summary_metrics.sum_DV_targeted.loc[clock_angle] = current_results.DV_targeted.sum()
        summary_metrics.sum_DV_analytic.loc[clock_angle] = current_results.DV_analytic.sum()
        summary_metrics.sum_DV_magnitude_difference.loc[clock_angle] = current_results.DV_magnitude_difference.abs().sum()
        summary_metrics.sum_DV_angle_difference.loc[clock_angle] = current_results.DV_angle_difference.sum()
        summary_metrics.sum_achieved_position_error_analytic.loc[clock_angle] = current_results.achieved_position_error_analytic.sum()
        summary_metrics.sum_achieved_position_error_targeted.loc[clock_angle] = current_results.achieved_position_error_targeted.sum()
        
        first = False
    
print 'summary_metrics', display(HTML(summary_metrics.to_html(float_format=lambda x: '{0:.3f}'.format(x))))

#    #results = results.append(current_results)


summary_metrics
approach clock_angle halo spacing sum_DV_analytic sum_DV_angle_difference sum_DV_magnitude_difference sum_DV_targeted sum_achieved_position_error_analytic sum_achieved_position_error_targeted timescale
0 +I 0.000 EM close 0.722 9.410 0.008 0.717 669.709 0.131 fast
1 +I 1.000 EM close 0.717 9.809 0.008 0.712 737.958 0.139 fast
2 +I 2.000 EM close 0.713 10.146 0.007 0.705 802.530 0.147 fast
3 +I 3.000 EM close 0.707 10.416 0.008 0.699 863.115 0.154 fast
4 +I 4.000 EM close 0.702 10.611 0.010 0.693 919.472 0.161 fast
5 +I 5.000 EM close 0.697 10.727 0.013 0.687 971.431 0.167 fast
6 +I 6.000 EM close 0.693 10.762 0.015 0.681 1018.899 0.173 fast
7 +I 7.000 EM close 0.688 10.715 0.018 0.676 1061.855 0.178 fast
8 +I 8.000 EM close 0.684 10.588 0.021 0.671 1100.341 0.182 fast
9 +I 9.000 EM close 0.680 10.437 0.024 0.667 1134.467 0.186 fast
10 +I 10.000 EM close 0.676 10.242 0.027 0.662 1164.387 0.189 fast
11 +I 11.000 EM close 0.672 9.982 0.030 0.659 1190.296 0.192 fast
12 +I 12.000 EM close 0.669 9.663 0.032 0.655 1212.408 0.139 fast
13 +I 13.000 EM close 0.667 9.295 0.035 0.653 1230.978 0.139 fast
14 +I 14.000 EM close 0.664 8.888 0.037 0.650 1246.248 0.139 fast
15 +I 15.000 EM close 0.662 8.450 0.039 0.648 1258.470 0.139 fast
16 +I 16.000 EM close 0.660 7.989 0.041 0.646 1267.890 0.138 fast
17 +I 17.000 EM close 0.659 7.513 0.042 0.644 1274.751 0.137 fast
18 +I 18.000 EM close 0.657 7.029 0.044 0.643 1279.283 0.137 fast
19 +I 19.000 EM close 0.656 6.541 0.045 0.642 1281.705 0.136 fast
20 +I 20.000 EM close 0.655 6.056 0.046 0.641 1282.220 0.135 fast
21 +I 21.000 EM close 0.654 5.577 0.047 0.640 1281.022 0.134 fast
22 +I 22.000 EM close 0.653 5.107 0.048 0.639 1278.287 0.133 fast
23 +I 23.000 EM close 0.652 4.650 0.048 0.639 1274.179 0.131 fast
24 +I 24.000 EM close 0.651 4.207 0.049 0.638 1268.849 0.130 fast
25 +I 25.000 EM close 0.651 3.789 0.049 0.638 1262.437 0.129 fast
26 +I 26.000 EM close 0.650 3.674 0.049 0.637 1255.070 0.128 fast
27 +I 27.000 EM close 0.650 3.556 0.049 0.637 1246.862 0.127 fast
28 +I 28.000 EM close 0.649 3.438 0.049 0.637 1237.920 0.125 fast
29 +I 29.000 EM close 0.649 3.320 0.049 0.637 1228.343 0.124 fast
30 +I 30.000 EM close 0.649 3.203 0.049 0.637 1218.218 0.123 fast
31 +I 31.000 EM close 0.648 3.089 0.049 0.637 1207.625 0.121 fast
32 +I 32.000 EM close 0.648 2.977 0.049 0.637 1196.635 0.120 fast
33 +I 33.000 EM close 0.648 2.868 0.049 0.637 1185.319 0.119 fast
34 +I 34.000 EM close 0.648 2.762 0.048 0.637 1173.734 0.118 fast
35 +I 35.000 EM close 0.647 2.660 0.048 0.637 1161.936 0.116 fast
36 +I 36.000 EM close 0.647 2.561 0.047 0.637 1149.974 0.115 fast
37 +I 37.000 EM close 0.647 2.467 0.047 0.637 1137.895 0.114 fast
38 +I 38.000 EM close 0.647 2.427 0.047 0.637 1125.733 0.112 fast
39 +I 39.000 EM close 0.647 2.517 0.046 0.637 1113.530 0.111 fast
40 +I 40.000 EM close 0.647 2.600 0.046 0.637 1101.324 0.110 fast
41 +I 41.000 EM close 0.647 2.676 0.045 0.637 1089.138 0.109 fast
42 +I 42.000 EM close 0.647 2.745 0.045 0.637 1077.000 0.108 fast
43 +I 43.000 EM close 0.647 2.808 0.044 0.638 1064.935 0.106 fast
44 +I 44.000 EM close 0.646 2.865 0.044 0.638 1052.965 0.105 fast
45 +I 45.000 EM close 0.646 2.917 0.043 0.638 1041.108 0.104 fast
46 +I 46.000 EM close 0.646 2.964 0.043 0.638 1029.382 0.103 fast
47 +I 47.000 EM close 0.646 3.007 0.042 0.638 1017.802 0.102 fast
48 +I 48.000 EM close 0.646 3.046 0.042 0.638 1006.381 0.101 fast
49 +I 49.000 EM close 0.646 3.080 0.041 0.638 995.130 0.100 fast
50 +I 50.000 EM close 0.646 3.111 0.041 0.638 984.060 0.099 fast
51 +I 51.000 EM close 0.646 3.139 0.040 0.638 973.184 0.150 fast
52 +I 52.000 EM close 0.646 3.167 0.040 0.638 962.502 0.149 fast
53 +I 53.000 EM close 0.646 3.243 0.039 0.638 952.015 0.147 fast
54 +I 54.000 EM close 0.646 3.313 0.039 0.638 941.746 0.146 fast
55 +I 55.000 EM close 0.646 3.378 0.038 0.638 931.694 0.144 fast
56 +I 56.000 EM close 0.646 3.439 0.038 0.639 921.856 0.143 fast
57 +I 57.000 EM close 0.646 3.494 0.037 0.639 912.239 0.142 fast
58 +I 58.000 EM close 0.646 3.546 0.037 0.639 902.844 0.140 fast
59 +I 59.000 EM close 0.646 3.596 0.037 0.639 893.674 0.219 fast
60 +I 60.000 EM close 0.646 3.640 0.036 0.639 884.729 0.217 fast
61 +I 61.000 EM close 0.646 3.681 0.036 0.639 876.008 0.216 fast
62 +I 62.000 EM close 0.646 3.718 0.035 0.639 867.513 0.214 fast
63 +I 63.000 EM close 0.646 3.753 0.035 0.639 859.243 0.212 fast
64 +I 64.000 EM close 0.646 3.785 0.035 0.639 851.199 0.211 fast
65 +I 65.000 EM close 0.646 3.814 0.034 0.639 843.378 0.209 fast
66 +I 66.000 EM close 0.646 3.841 0.034 0.639 835.791 0.208 fast
67 +I 67.000 EM close 0.646 3.865 0.033 0.639 828.409 0.207 fast
68 +I 68.000 EM close 0.646 3.888 0.033 0.639 821.243 0.205 fast
69 +I 69.000 EM close 0.646 3.909 0.033 0.639 814.293 0.204 fast
70 +I 70.000 EM close 0.646 3.928 0.033 0.639 807.553 0.203 fast
71 +I 71.000 EM close 0.646 3.946 0.032 0.639 801.025 0.202 fast
72 +I 72.000 EM close 0.646 3.962 0.032 0.639 794.704 0.200 fast
73 +I 73.000 EM close 0.646 3.977 0.032 0.639 788.587 0.199 fast
74 +I 74.000 EM close 0.646 3.991 0.031 0.639 782.671 0.198 fast
75 +I 75.000 EM close 0.646 4.003 0.031 0.639 776.953 0.197 fast
76 +I 76.000 EM close 0.646 4.015 0.031 0.639 771.437 0.196 fast
77 +I 77.000 EM close 0.646 4.026 0.031 0.639 766.107 0.195 fast
78 +I 78.000 EM close 0.646 4.036 0.030 0.639 760.962 0.194 fast
79 +I 79.000 EM close 0.646 4.051 0.030 0.639 754.633 0.193 fast
80 +I 80.000 EM close 0.646 4.053 0.030 0.639 751.219 0.193 fast
81 +I 81.000 EM close 0.646 4.061 0.030 0.639 746.617 0.192 fast
82 +I 82.000 EM close 0.646 4.069 0.029 0.639 742.188 0.191 fast
83 +I 83.000 EM close 0.646 4.076 0.029 0.639 737.929 0.190 fast
84 +I 84.000 EM close 0.646 4.082 0.029 0.639 733.837 0.190 fast
85 +I 85.000 EM close 0.646 4.088 0.029 0.639 729.907 0.189 fast
86 +I 86.000 EM close 0.646 4.094 0.029 0.639 726.136 0.188 fast
87 +I 87.000 EM close 0.646 4.100 0.029 0.639 722.520 0.188 fast
88 +I 88.000 EM close 0.646 4.105 0.028 0.639 719.060 0.187 fast
89 +I 89.000 EM close 0.646 4.110 0.028 0.639 715.744 0.187 fast
90 +I 90.000 EM close 0.646 4.119 0.028 0.639 711.541 0.186 fast
91 +I 91.000 EM close 0.646 4.120 0.028 0.639 709.522 0.186 fast
92 +I 92.000 EM close 0.646 4.125 0.028 0.639 706.626 0.185 fast
93 +I 93.000 EM close 0.646 4.129 0.028 0.639 703.863 0.185 fast
94 +I 94.000 EM close 0.646 4.134 0.028 0.639 701.228 0.185 fast
95 +I 95.000 EM close 0.646 4.139 0.027 0.639 698.717 0.184 fast
96 +I 96.000 EM close 0.646 4.143 0.027 0.639 696.327 0.184 fast
97 +I 97.000 EM close 0.646 4.148 0.027 0.640 694.054 0.183 fast
98 +I 98.000 EM close 0.646 4.152 0.027 0.640 691.893 0.183 fast
99 +I 99.000 EM close 0.646 4.157 0.027 0.640 689.842 0.183 fast
100 +I 100.000 EM close 0.646 4.162 0.027 0.640 687.894 0.182 fast
101 +I 101.000 EM close 0.646 4.167 0.027 0.640 686.047 0.182 fast
102 +I 102.000 EM close 0.646 4.172 0.027 0.640 684.296 0.182 fast
103 +I 103.000 EM close 0.646 4.177 0.027 0.640 682.637 0.182 fast
104 +I 104.000 EM close 0.646 4.182 0.027 0.640 681.065 0.181 fast
105 +I 105.000 EM close 0.646 4.187 0.027 0.640 679.576 0.181 fast
106 +I 106.000 EM close 0.646 4.192 0.026 0.640 678.166 0.181 fast
107 +I 107.000 EM close 0.646 4.198 0.026 0.640 676.829 0.181 fast
108 +I 108.000 EM close 0.646 4.203 0.026 0.640 675.561 0.180 fast
109 +I 109.000 EM close 0.646 4.208 0.026 0.640 674.355 0.180 fast
110 +I 110.000 EM close 0.646 4.214 0.026 0.640 673.209 0.180 fast
111 +I 111.000 EM close 0.646 4.219 0.026 0.640 672.117 0.179 fast
112 +I 112.000 EM close 0.646 4.224 0.026 0.640 671.072 0.179 fast
113 +I 113.000 EM close 0.646 4.230 0.026 0.640 670.069 0.179 fast
114 +I 114.000 EM close 0.646 4.235 0.026 0.640 669.102 0.179 fast
115 +I 115.000 EM close 0.646 4.240 0.026 0.640 668.165 0.178 fast
116 +I 116.000 EM close 0.646 4.245 0.026 0.640 667.250 0.178 fast
117 +I 117.000 EM close 0.646 4.249 0.026 0.640 666.352 0.178 fast
118 +I 118.000 EM close 0.646 4.254 0.026 0.640 665.462 0.177 fast
119 +I 119.000 EM close 0.646 4.257 0.026 0.640 664.573 0.177 fast
120 +I 120.000 EM close 0.646 4.261 0.026 0.640 663.677 0.176 fast
121 +I 121.000 EM close 0.646 4.263 0.026 0.640 662.763 0.176 fast
122 +I 122.000 EM close 0.646 4.265 0.026 0.640 661.824 0.175 fast
123 +I 123.000 EM close 0.646 4.266 0.026 0.640 660.848 0.175 fast
124 +I 124.000 EM close 0.646 4.266 0.026 0.641 659.825 0.174 fast
125 +I 125.000 EM close 0.647 4.264 0.026 0.641 658.742 0.173 fast
126 +I 126.000 EM close 0.647 4.261 0.025 0.641 657.586 0.172 fast
127 +I 127.000 EM close 0.647 4.256 0.025 0.641 656.342 0.171 fast
128 +I 128.000 EM close 0.647 4.249 0.025 0.641 654.996 0.170 fast
129 +I 129.000 EM close 0.647 4.239 0.025 0.641 653.529 0.169 fast
130 +I 130.000 EM close 0.647 4.227 0.025 0.642 651.923 0.168 fast
131 +I 131.000 EM close 0.647 4.211 0.025 0.642 650.156 0.167 fast
132 +I 132.000 EM close 0.648 4.192 0.025 0.642 648.204 0.165 fast
133 +I 133.000 EM close 0.648 4.168 0.025 0.642 646.044 0.163 fast
134 +I 134.000 EM close 0.648 4.139 0.025 0.643 643.646 0.161 fast
135 +I 135.000 EM close 0.649 4.104 0.025 0.643 640.974 0.255 fast
136 +I 136.000 EM close 0.649 4.063 0.025 0.644 638.001 0.252 fast
137 +I 137.000 EM close 0.649 4.015 0.025 0.644 634.685 0.249 fast
138 +I 138.000 EM close 0.650 3.959 0.024 0.645 630.984 0.245 fast
139 +I 139.000 EM close 0.650 3.895 0.024 0.645 626.855 0.241 fast
140 +I 140.000 EM close 0.651 3.821 0.024 0.646 622.249 0.236 fast
141 +I 141.000 EM close 0.652 3.736 0.024 0.647 617.115 0.231 fast
142 +I 142.000 EM close 0.653 3.641 0.024 0.648 611.402 0.226 fast
143 +I 143.000 EM close 0.654 3.535 0.023 0.649 605.061 0.219 fast
144 +I 144.000 EM close 0.655 3.417 0.023 0.650 598.042 0.212 fast
145 +I 145.000 EM close 0.656 3.287 0.023 0.652 590.309 0.205 fast
146 +I 146.000 EM close 0.657 3.146 0.023 0.653 581.815 0.196 fast
147 +I 147.000 EM close 0.659 2.998 0.022 0.655 572.542 0.265 fast
148 +I 148.000 EM close 0.660 2.836 0.022 0.657 562.477 0.238 fast
149 +I 149.000 EM close 0.662 2.666 0.021 0.659 551.621 0.209 fast
150 +I 150.000 EM close 0.664 2.485 0.021 0.661 539.986 0.253 fast
151 +I 151.000 EM close 0.666 2.308 0.021 0.664 527.590 0.251 fast
152 +I 152.000 EM close 0.668 2.347 0.020 0.666 522.216 0.230 fast
153 +I 153.000 EM close 0.671 2.394 0.020 0.669 516.746 0.191 fast
154 +I 154.000 EM close 0.674 2.426 0.019 0.672 510.294 0.213 fast
155 +I 155.000 EM close 0.677 2.444 0.019 0.675 502.728 0.234 fast
156 +I 156.000 EM close 0.680 2.444 0.018 0.679 493.905 0.254 fast
157 +I 157.000 EM close 0.684 2.419 0.018 0.683 483.233 0.163 fast
158 +I 158.000 EM close 0.688 2.376 0.017 0.687 471.916 0.163 fast
159 +I 159.000 EM close 0.693 2.313 0.016 0.692 458.460 0.162 fast
160 +I 160.000 EM close 0.698 2.227 0.016 0.698 443.176 0.160 fast
161 +I 161.000 EM close 0.704 2.119 0.015 0.704 425.937 0.158 fast
162 +I 162.000 EM close 0.710 2.118 0.014 0.711 406.632 0.154 fast
163 +I 163.000 EM close 0.718 2.174 0.014 0.719 385.179 0.149 fast
164 +I 164.000 EM close 0.726 2.237 0.013 0.727 361.534 0.143 fast
165 +I 165.000 EM close 0.734 2.308 0.012 0.736 335.699 0.214 fast
166 +I 166.000 EM close 0.743 2.393 0.011 0.745 307.757 0.182 fast
167 +I 167.000 EM close 0.752 2.490 0.010 0.755 277.833 0.149 fast
168 +I 168.000 EM close 0.761 2.601 0.009 0.764 246.134 0.180 fast
169 +I 169.000 EM close 0.770 2.708 0.008 0.773 248.433 0.217 fast
170 +I 170.000 EM close 0.778 2.832 0.007 0.781 256.060 0.175 fast
171 +I 171.000 EM close 0.785 2.946 0.006 0.788 262.157 0.210 fast
172 +I 172.000 EM close 0.790 3.048 0.004 0.794 266.410 0.244 fast
173 +I 173.000 EM close 0.794 3.260 0.004 0.797 268.552 0.154 fast
174 +I 174.000 EM close 0.796 3.507 0.004 0.799 268.420 0.161 fast
175 +I 175.000 EM close 0.796 3.738 0.004 0.798 265.916 0.218 fast
176 +I 176.000 EM close 0.793 3.946 0.004 0.795 261.060 0.211 fast
177 +I 177.000 EM close 0.789 4.128 0.004 0.791 253.970 0.202 fast
178 +I 178.000 EM close 0.783 4.283 0.004 0.784 244.868 0.192 fast
179 +I 179.000 EM close 0.775 4.480 0.004 0.776 249.670 0.222 fast
180 +I 180.000 EM close 0.767 4.797 0.004 0.767 283.845 0.216 fast
181 +I 181.000 EM close 0.757 5.103 0.004 0.757 316.686 0.238 fast
182 +I 182.000 EM close 0.747 5.391 0.004 0.746 347.973 0.259 fast
183 +I 183.000 EM close 0.737 5.660 0.004 0.736 377.510 0.218 fast
184 +I 184.000 EM close 0.727 5.900 0.003 0.725 405.152 0.224 fast
185 +I 185.000 EM close 0.718 6.110 0.003 0.716 430.799 0.230 fast
186 +I 186.000 EM close 0.709 6.286 0.004 0.706 454.408 0.235 fast
187 +I 187.000 EM close 0.701 6.425 0.005 0.698 475.992 0.240 fast
188 +I 188.000 EM close 0.694 6.529 0.006 0.691 495.608 0.244 fast
189 +I 189.000 EM close 0.688 6.598 0.008 0.684 513.347 0.248 fast
190 +I 190.000 EM close 0.682 6.635 0.009 0.678 529.327 0.251 fast
191 +I 191.000 EM close 0.677 6.643 0.010 0.673 543.679 0.254 fast
192 +I 192.000 EM close 0.673 6.625 0.012 0.668 556.542 0.257 fast
193 +I 193.000 EM close 0.669 6.586 0.013 0.664 568.052 0.259 fast
194 +I 194.000 EM close 0.666 6.526 0.014 0.660 578.346 0.169 fast
195 +I 195.000 EM close 0.663 6.455 0.015 0.658 587.541 0.170 fast
196 +I 196.000 EM close 0.661 6.373 0.016 0.655 595.763 0.171 fast
197 +I 197.000 EM close 0.659 6.283 0.016 0.653 603.111 0.172 fast
198 +I 198.000 EM close 0.657 6.187 0.017 0.651 609.684 0.173 fast
199 +I 199.000 EM close 0.655 6.087 0.018 0.649 615.569 0.174 fast
200 +I 200.000 EM close 0.654 5.985 0.019 0.648 620.842 0.175 fast
201 +I 201.000 EM close 0.653 5.882 0.019 0.647 625.574 0.176 fast
202 +I 202.000 EM close 0.652 5.780 0.020 0.645 629.826 0.176 fast
203 +I 203.000 EM close 0.651 5.678 0.020 0.645 633.652 0.177 fast
204 +I 204.000 EM close 0.651 5.579 0.021 0.644 637.102 0.178 fast
205 +I 205.000 EM close 0.650 5.481 0.021 0.643 640.218 0.178 fast
206 +I 206.000 EM close 0.649 5.386 0.022 0.642 643.037 0.179 fast
207 +I 207.000 EM close 0.649 5.294 0.022 0.642 645.602 0.179 fast
208 +I 208.000 EM close 0.649 5.205 0.022 0.641 647.934 0.180 fast
209 +I 209.000 EM close 0.648 5.119 0.023 0.641 650.063 0.180 fast
210 +I 210.000 EM close 0.648 5.036 0.023 0.641 652.016 0.181 fast
211 +I 211.000 EM close 0.648 4.956 0.023 0.640 653.814 0.181 fast
212 +I 212.000 EM close 0.647 4.879 0.023 0.640 655.478 0.181 fast
213 +I 213.000 EM close 0.647 4.806 0.023 0.640 657.027 0.182 fast
214 +I 214.000 EM close 0.647 4.735 0.024 0.640 658.477 0.182 fast
215 +I 215.000 EM close 0.647 4.667 0.024 0.639 659.843 0.183 fast
216 +I 216.000 EM close 0.647 4.602 0.024 0.639 661.141 0.183 fast
217 +I 217.000 EM close 0.647 4.540 0.024 0.639 662.382 0.184 fast
218 +I 218.000 EM close 0.647 4.481 0.024 0.639 663.579 0.184 fast
219 +I 219.000 EM close 0.646 4.424 0.025 0.639 664.742 0.185 fast
220 +I 220.000 EM close 0.646 4.369 0.025 0.639 665.883 0.185 fast
221 +I 221.000 EM close 0.646 4.317 0.025 0.639 667.010 0.186 fast
222 +I 222.000 EM close 0.646 4.266 0.025 0.639 668.133 0.186 fast
223 +I 223.000 EM close 0.646 4.218 0.025 0.639 669.259 0.187 fast
224 +I 224.000 EM close 0.646 4.172 0.025 0.638 670.398 0.187 fast
225 +I 225.000 EM close 0.646 4.127 0.025 0.638 671.556 0.188 fast
226 +I 226.000 EM close 0.646 4.085 0.025 0.638 672.741 0.188 fast
227 +I 227.000 EM close 0.646 4.044 0.025 0.638 673.958 0.189 fast
228 +I 228.000 EM close 0.646 4.004 0.026 0.638 675.216 0.190 fast
229 +I 229.000 EM close 0.646 3.966 0.026 0.638 676.519 0.190 fast
230 +I 230.000 EM close 0.646 3.929 0.026 0.638 677.874 0.191 fast
231 +I 231.000 EM close 0.646 3.894 0.026 0.638 679.286 0.192 fast
232 +I 232.000 EM close 0.646 3.859 0.026 0.638 680.761 0.192 fast
233 +I 233.000 EM close 0.646 3.826 0.026 0.638 682.304 0.193 fast
234 +I 234.000 EM close 0.646 3.793 0.026 0.638 683.921 0.194 fast
235 +I 235.000 EM close 0.646 3.762 0.026 0.638 685.615 0.195 fast
236 +I 236.000 EM close 0.646 3.731 0.026 0.638 687.392 0.196 fast
237 +I 237.000 EM close 0.646 3.701 0.027 0.638 689.257 0.197 fast
238 +I 238.000 EM close 0.646 3.672 0.027 0.638 691.213 0.198 fast
239 +I 239.000 EM close 0.646 3.643 0.027 0.638 693.266 0.199 fast
240 +I 240.000 EM close 0.646 3.615 0.027 0.638 695.420 0.200 fast
241 +I 241.000 EM close 0.646 3.587 0.027 0.638 697.680 0.201 fast
242 +I 242.000 EM close 0.646 3.560 0.027 0.638 700.048 0.202 fast
243 +I 243.000 EM close 0.646 3.532 0.027 0.638 702.530 0.203 fast
244 +I 244.000 EM close 0.646 3.505 0.027 0.638 705.129 0.204 fast
245 +I 245.000 EM close 0.646 3.478 0.028 0.638 707.851 0.205 fast
246 +I 246.000 EM close 0.646 3.451 0.028 0.638 710.697 0.118 fast
247 +I 247.000 EM close 0.646 3.424 0.028 0.638 713.674 0.119 fast
248 +I 248.000 EM close 0.646 3.396 0.028 0.637 716.784 0.119 fast
249 +I 249.000 EM close 0.646 3.368 0.028 0.637 720.031 0.120 fast
250 +I 250.000 EM close 0.646 3.340 0.028 0.637 723.418 0.121 fast
251 +I 251.000 EM close 0.647 3.311 0.028 0.637 726.951 0.121 fast
252 +I 252.000 EM close 0.647 3.282 0.029 0.637 730.634 0.122 fast
253 +I 253.000 EM close 0.647 3.252 0.029 0.637 734.467 0.123 fast
254 +I 254.000 EM close 0.647 3.221 0.029 0.637 738.455 0.124 fast
255 +I 255.000 EM close 0.647 3.189 0.029 0.637 742.603 0.124 fast
256 +I 256.000 EM close 0.647 3.156 0.029 0.637 746.914 0.125 fast
257 +I 257.000 EM close 0.647 3.123 0.030 0.637 751.391 0.126 fast
258 +I 258.000 EM close 0.647 3.087 0.030 0.637 756.037 0.127 fast
259 +I 259.000 EM close 0.647 3.051 0.030 0.637 760.857 0.128 fast
260 +I 260.000 EM close 0.647 3.013 0.030 0.637 765.853 0.129 fast
261 +I 261.000 EM close 0.647 2.973 0.030 0.637 771.030 0.130 fast
262 +I 262.000 EM close 0.647 2.927 0.031 0.637 775.751 0.131 fast
263 +I 263.000 EM close 0.647 2.888 0.031 0.637 781.944 0.132 fast
264 +I 264.000 EM close 0.647 2.842 0.031 0.637 787.679 0.133 fast
265 +I 265.000 EM close 0.647 2.795 0.031 0.637 793.605 0.134 fast
266 +I 266.000 EM close 0.647 2.744 0.032 0.636 799.726 0.135 fast
267 +I 267.000 EM close 0.647 2.692 0.032 0.636 806.044 0.137 fast
268 +I 268.000 EM close 0.647 2.636 0.032 0.636 812.562 0.138 fast
269 +I 269.000 EM close 0.647 2.578 0.033 0.636 819.283 0.139 fast
270 +I 270.000 EM close 0.647 2.517 0.033 0.636 826.208 0.140 fast
271 +I 271.000 EM close 0.647 2.452 0.033 0.636 833.339 0.142 fast
272 +I 272.000 EM close 0.647 2.384 0.033 0.636 840.679 0.143 fast
273 +I 273.000 EM close 0.647 2.313 0.034 0.636 848.228 0.144 fast
274 +I 274.000 EM close 0.647 2.238 0.034 0.636 855.986 0.146 fast
275 +I 275.000 EM close 0.648 2.158 0.034 0.636 863.957 0.147 fast
276 +I 276.000 EM close 0.648 2.078 0.035 0.636 872.141 0.149 fast
277 +I 277.000 EM close 0.648 2.052 0.035 0.636 880.537 0.150 fast
278 +I 278.000 EM close 0.648 2.025 0.036 0.635 889.146 0.152 fast
279 +I 279.000 EM close 0.648 1.996 0.036 0.635 897.966 0.153 fast
280 +I 280.000 EM close 0.648 1.966 0.036 0.635 906.996 0.155 fast
281 +I 281.000 EM close 0.648 1.933 0.037 0.635 916.236 0.156 fast
282 +I 282.000 EM close 0.648 1.899 0.037 0.635 925.681 0.158 fast
283 +I 283.000 EM close 0.648 1.863 0.038 0.635 935.331 0.160 fast
284 +I 284.000 EM close 0.648 1.821 0.038 0.635 944.072 0.161 fast
285 +I 285.000 EM close 0.648 1.785 0.038 0.635 955.215 0.163 fast
286 +I 286.000 EM close 0.648 1.742 0.039 0.635 965.450 0.165 fast
287 +I 287.000 EM close 0.648 1.697 0.039 0.635 975.870 0.167 fast
288 +I 288.000 EM close 0.648 1.775 0.040 0.635 986.468 0.168 fast
289 +I 289.000 EM close 0.648 1.868 0.040 0.635 997.234 0.170 fast
290 +I 290.000 EM close 0.648 1.962 0.041 0.635 1008.160 0.172 fast
291 +I 291.000 EM close 0.649 2.059 0.041 0.634 1019.236 0.174 fast
292 +I 292.000 EM close 0.649 2.159 0.042 0.634 1030.449 0.175 fast
293 +I 293.000 EM close 0.649 2.260 0.042 0.634 1041.786 0.177 fast
294 +I 294.000 EM close 0.649 2.363 0.043 0.634 1053.233 0.179 fast
295 +I 295.000 EM close 0.649 2.467 0.043 0.634 1064.771 0.181 fast
296 +I 296.000 EM close 0.649 2.572 0.043 0.634 1076.383 0.183 fast
297 +I 297.000 EM close 0.649 2.678 0.044 0.634 1088.044 0.184 fast
298 +I 298.000 EM close 0.649 2.784 0.044 0.634 1099.740 0.186 fast
299 +I 299.000 EM close 0.649 2.889 0.045 0.634 1111.440 0.188 fast
300 +I 300.000 EM close 0.649 2.992 0.045 0.634 1123.118 0.189 fast
301 +I 301.000 EM close 0.649 3.093 0.046 0.634 1134.742 0.191 fast
302 +I 302.000 EM close 0.650 3.261 0.046 0.634 1146.280 0.192 fast
303 +I 303.000 EM close 0.650 3.462 0.047 0.634 1157.695 0.194 fast
304 +I 304.000 EM close 0.650 3.662 0.047 0.635 1168.948 0.195 fast
305 +I 305.000 EM close 0.650 3.860 0.048 0.635 1179.992 0.196 fast
306 +I 306.000 EM close 0.650 4.056 0.048 0.635 1190.780 0.198 fast
307 +I 307.000 EM close 0.650 4.248 0.049 0.635 1201.262 0.199 fast
308 +I 308.000 EM close 0.650 4.434 0.049 0.635 1211.380 0.200 fast
309 +I 309.000 EM close 0.651 4.613 0.049 0.635 1221.072 0.200 fast
310 +I 310.000 EM close 0.651 4.783 0.050 0.636 1230.271 0.201 fast
311 +I 311.000 EM close 0.651 4.941 0.050 0.636 1238.906 0.201 fast
312 +I 312.000 EM close 0.651 5.085 0.050 0.636 1246.897 0.202 fast
313 +I 313.000 EM close 0.651 5.214 0.051 0.637 1254.161 0.202 fast
314 +I 314.000 EM close 0.652 5.324 0.051 0.637 1260.608 0.201 fast
315 +I 315.000 EM close 0.652 5.413 0.051 0.638 1266.142 0.201 fast
316 +I 316.000 EM close 0.652 5.478 0.051 0.638 1270.662 0.200 fast
317 +I 317.000 EM close 0.653 5.518 0.051 0.639 1274.058 0.199 fast
318 +I 318.000 EM close 0.653 5.529 0.051 0.640 1276.220 0.198 fast
319 +I 319.000 EM close 0.654 5.515 0.051 0.641 1277.032 0.302 fast
320 +I 320.000 EM close 0.654 5.462 0.051 0.642 1276.375 0.293 fast
321 +I 321.000 EM close 0.655 5.374 0.051 0.643 1274.130 0.283 fast
322 +I 322.000 EM close 0.655 5.250 0.051 0.644 1270.177 0.272 fast
323 +I 323.000 EM close 0.656 5.099 0.051 0.645 1264.402 0.260 fast
324 +I 324.000 EM close 0.657 5.001 0.050 0.647 1256.694 0.247 fast
325 +I 325.000 EM close 0.658 4.871 0.050 0.648 1246.953 0.232 fast
326 +I 326.000 EM close 0.659 4.711 0.049 0.650 1235.084 0.217 fast
327 +I 327.000 EM close 0.660 4.525 0.049 0.651 1221.006 0.201 fast
328 +I 328.000 EM close 0.661 4.318 0.048 0.653 1204.646 0.263 fast
329 +I 329.000 EM close 0.662 4.259 0.048 0.655 1185.950 0.204 fast
330 +I 330.000 EM close 0.664 4.464 0.047 0.657 1166.519 0.227 fast
331 +I 331.000 EM close 0.665 4.658 0.046 0.660 1160.691 0.144 fast
332 +I 332.000 EM close 0.667 4.816 0.045 0.662 1152.380 0.199 fast
333 +I 333.000 EM close 0.668 4.930 0.044 0.665 1141.149 0.127 fast
334 +I 334.000 EM close 0.670 5.006 0.043 0.668 1126.735 0.139 fast
335 +I 335.000 EM close 0.673 5.034 0.041 0.671 1108.876 0.151 fast
336 +I 336.000 EM close 0.675 5.010 0.040 0.674 1087.325 0.162 fast
337 +I 337.000 EM close 0.677 4.930 0.039 0.677 1061.844 0.171 fast
338 +I 338.000 EM close 0.680 4.791 0.037 0.681 1032.225 0.180 fast
339 +I 339.000 EM close 0.683 4.620 0.036 0.684 998.283 0.155 fast
340 +I 340.000 EM close 0.687 4.887 0.034 0.689 959.857 0.248 fast
341 +I 341.000 EM close 0.690 5.142 0.032 0.693 916.846 0.233 fast
342 +I 342.000 EM close 0.694 5.378 0.031 0.697 869.201 0.216 fast
343 +I 343.000 EM close 0.698 5.599 0.029 0.702 816.938 0.197 fast
344 +I 344.000 EM close 0.702 5.805 0.027 0.707 760.151 0.178 fast
345 +I 345.000 EM close 0.707 5.996 0.025 0.712 699.026 0.157 fast
346 +I 346.000 EM close 0.711 6.170 0.023 0.717 633.895 0.195 fast
347 +I 347.000 EM close 0.716 6.327 0.020 0.722 568.126 0.154 fast
348 +I 348.000 EM close 0.720 6.456 0.018 0.726 575.259 0.178 fast
349 +I 349.000 EM close 0.724 6.551 0.015 0.730 589.484 0.145 fast
350 +I 350.000 EM close 0.728 6.606 0.012 0.734 600.514 0.162 fast
351 +I 351.000 EM close 0.731 6.611 0.010 0.736 607.820 0.179 fast
352 +I 352.000 EM close 0.733 6.959 0.008 0.738 611.050 0.194 fast
353 +I 353.000 EM close 0.735 7.377 0.008 0.739 609.959 0.208 fast
354 +I 354.000 EM close 0.736 7.743 0.008 0.739 604.423 0.221 fast
355 +I 355.000 EM close 0.735 8.040 0.008 0.737 594.451 0.120 fast
356 +I 356.000 EM close 0.734 8.275 0.008 0.735 580.182 0.119 fast
357 +I 357.000 EM close 0.732 8.438 0.008 0.732 561.905 0.153 fast
358 +I 358.000 EM close 0.730 8.525 0.007 0.728 540.592 0.154 fast
359 +I 359.000 EM close 0.726 8.959 0.008 0.723 598.324 0.148 fast
 None

In [49]:
fig3, (ax3) = plt.subplots(1,1);
ax3.plot(summary_metrics.clock_angle, summary_metrics.sum_DV_analytic, label='Sum of Linear \(\Delta V\)')
ax3.plot(summary_metrics.clock_angle, summary_metrics.sum_DV_targeted, label='Sum of Targeted \(\Delta V\)')
#lims = ylim()
#ylim([0, lims[1]]) 
ax3.set_title('Total Rendezvous \(\Delta V\) vs. Clock Angle')
ax3.xaxis.set_label_text('Clock Angle (degrees)')
ax3.yaxis.set_label_text('Sum of \(\Delta V\) (m/s)')
ax3.legend(loc='upper right')

fig4, (ax4) = plt.subplots(1,1);
ax4.plot(summary_metrics.clock_angle, summary_metrics.sum_DV_magnitude_difference)
ax4.set_title('Linear-Targeted \(\Delta V\) Difference vs. Clock Angle')
ax4.xaxis.set_label_text('Clock Angle (degrees)')
ax4.yaxis.set_label_text('\(\Delta V\) Difference (m/s)')

fig5, (ax5) = plt.subplots(1,1);
ax5.plot(summary_metrics.clock_angle, summary_metrics.sum_achieved_position_error_analytic, label='Sum of Linear Position Error')
ax5.plot(summary_metrics.clock_angle, summary_metrics.sum_achieved_position_error_targeted, label='Sum of Targeted Position Error')
ax5.semilogy()
ax5.set_title('Total Rendezvous Position Error vs. Clock Angle')
ax5.xaxis.set_label_text('Clock Angle (degrees)')
ax5.yaxis.set_label_text('Sum of Position Error (log(m))')
ax5.legend(loc='upper right')

fig6, (ax6) = plt.subplots(1,1);
ax6.plot(summary_metrics.clock_angle, summary_metrics.sum_DV_angle_difference)
ax6.set_title('Linear-Targeted \(\Delta V\) Angle Difference vs. Clock Angle')
ax6.xaxis.set_label_text('Clock Angle (degrees)')
ax6.yaxis.set_label_text('\(\Delta V\) Angle Difference (deg)')

fig7, (ax7) = plt.subplots(1,1);
ax7.plot(summary_metrics.clock_angle, (summary_metrics.sum_DV_analytic-summary_metrics.sum_DV_targeted).abs()/summary_metrics.sum_DV_analytic*100)
ax7.set_title('Linear-Targeted \(\Delta V\) Difference vs. Clock Angle')
ax7.xaxis.set_label_text('Clock Angle (degrees)')
ax7.yaxis.set_label_text('\(\Delta V\) Difference (\%)')


Out[49]:
<matplotlib.text.Text at 0x12f3f5850>
results.loc[(halo, clock_angle, approach, timescale, spacing)] waypoint_metrics.groupby(["approach", "halo"]).apply(lambda x: pd.DataFrame({"foo": [x.DV_analytic.sum()]})) df = pd.DataFrame({"bar": [2,4,6,8]}) foo = conditions.groupby("halo").apply(run_simulation) results = conditions.apply(run_simulation)